use mf_macro::mf_meta;
use std::sync::Arc;
use mf_macro::mf_plugin;
// 措施项目插件
use mf_state::error::StateResult;
use mf_state::plugin::{PluginMetadata, PluginTrait};
use mf_state::state::State;
use mf_state::transaction::Transaction;

/// 措施项目插件
/// 用于处理措施项目的插入 新增 删除 修改
/// 更新完 当前数据的单条计算
async fn append_transaction(
    _trs: &[Arc<Transaction>],
    _old_state: &Arc<State>,
    _new_state: &Arc<State>,
) -> StateResult<Option<Transaction>> {
    // todo
    Ok(None)
}
async fn filter_transaction(
    _tr: &Transaction,
    _state: &State,
) -> bool {
    // todo
    true
}
mf_plugin!(
    plugin_csxm,
    metadata = mf_meta!(version = "1.0.0", description = "措施项目插件", author = "ModuForge Team", tags = []),
    append_transaction = append_transaction,
    filter_transaction=filter_transaction
);